From 12b1cdb52a9d2723c319083b45a4e9a21896b3b4 Mon Sep 17 00:00:00 2001 From: Sebastien Castiel Date: Wed, 6 Dec 2023 17:02:37 -0500 Subject: Balances --- src/app/groups/[groupId]/page.tsx | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'src/app/groups/[groupId]/page.tsx') diff --git a/src/app/groups/[groupId]/page.tsx b/src/app/groups/[groupId]/page.tsx index 83fc3ef..7fffcb3 100644 --- a/src/app/groups/[groupId]/page.tsx +++ b/src/app/groups/[groupId]/page.tsx @@ -1,3 +1,4 @@ +import { BalancesList } from '@/app/groups/[groupId]/balances-list' import { SaveGroupLocally } from '@/app/groups/[groupId]/save-recent-group' import { Badge } from '@/components/ui/badge' import { Button } from '@/components/ui/button' @@ -17,6 +18,7 @@ import { TableRow, } from '@/components/ui/table' import { getGroup, getGroupExpenses } from '@/lib/api' +import { getBalances } from '@/lib/balances' import { ChevronRight, Plus } from 'lucide-react' import Link from 'next/link' import { notFound } from 'next/navigation' @@ -30,6 +32,7 @@ export default async function GroupPage({ if (!group) notFound() const expenses = await getGroupExpenses(groupId) + const balances = getBalances(expenses) return ( <> @@ -52,7 +55,7 @@ export default async function GroupPage({ {expenses.length > 0 ? ( - +
Title @@ -115,14 +118,17 @@ export default async function GroupPage({ - Participants + Balances + + This is the amount that each participant paid or was paid for. + -
    - {group.participants.map((participant) => ( -
  • {participant.name}
  • - ))} -
+
-- cgit v1.3